﻿using System;
using System.Collections.Generic;
using System.Text;
//MicroDesigner
using Jc.MicroDesigner.Objects;
using Jc.MicroDesigner.Management;
using Jc.MicroDesigner.Drawings;

namespace Jc.MicroDesigner.ElementsLib
{
    /// <summary>
    /// Элемент "М2"
    /// </summary>
    [DrawingToolItem("М2")]
    public class EXOR : RealElement
    {
        public EXOR(ObjectManager manager) : base(manager, "exor.xml") { }

        protected override sbyte ComputeSignal()
        {
            sbyte a = _PINCollection[0].Signal;
            sbyte b = _PINCollection[1].Signal;
            sbyte value = Convert.ToSByte(((a == 1 && b == 1)||(a == 0 && b == 0)) ? 0 : 1);
            return value;
        }
    }
}